Skip to content

WIP LORA image generation#4084

Draft
atobiszei wants to merge 21 commits intomainfrom
atobisze_image_inpainting_lora
Draft

WIP LORA image generation#4084
atobiszei wants to merge 21 commits intomainfrom
atobisze_image_inpainting_lora

Conversation

@atobiszei
Copy link
Collaborator

🛠 Summary

JIRA/Issue if applicable.
Describe the changes.

🧪 Checklist

  • Unit tests added.
  • The documentation updated.
  • Change follows security best practices.
    ``

atobiszei added 21 commits March 2, 2026 16:28
mask field should only be accepted in image edit (inpainting) requests,
not in text-to-image generation requests.
- Add --source_loras CLI parameter for specifying LoRA adapters
  Format: alias=org/repo@file.safetensors (comma-separated, @file optional)
- Add LoRA adapter entries to image_gen_calculator.proto
- Parse and validate LoRA settings in image_generation_graph_cli_parser
- Export LoRA adapter entries in graph.pbtxt generation
- Load LoRA .safetensors via ov::genai::Adapter in pipelines.cpp
- Apply LoRA adapters at inference time based on model name routing
- Download LoRA repos via curl (resolve safetensors filename from HF API)
- Add LoRA alias routing in mediapipe factory
- Pass modelName through HttpPayload for LoRA alias matching
- Add 18 unit tests (CLI parsing, graph export, proto parsing, config)
- Support multiple LoRA source types: HF repo, direct URL, local file (alias= required)
- Extract shared curl_downloader utility from gguf_downloader
- Add composite LoRA aliases (e.g. blend=@pokemon:0.7+@Anime:0.5)
- Support per-request lora_weights override in extra_body
- Local files referenced by absolute path in graph.pbtxt (no copy)
- HF LoRA: resolve .safetensors via API, download with curl
- clone() delegates to pullLoraAdapters() for all LoRA downloads
- resolveHfLoraFilenames() + pullLoraAdapters() split (private -> protected)
- Remove loraQueue: T2I/I2I always use clone(), only inpainting serialized
- PipelineSlotGuard (renamed from InpaintingQueueGuard)
- compileProperties built once in constructor (no default arg on reshapeAndCompile)
- CompositeLoraMap type alias replaces duplicate runtime structs
- Multiline composite formatting in graph.pbtxt
- Add RUN_UNSTABLE-gated pull tests for LoRA (HF resolve, download, full-flow)
- Add non-network unit tests (local file skip, non-imagegen no-op)
- Add SetUpServerForDownloadWithLoras test helper
- 59 tests pass (55 original + 4 new, 3 network-gated skip without RUN_UNSTABLE)
Resolved conflicts in:
- pipelines.hpp: keep PipelineSlotGuard name and LoRA fields, adopt main's blocking comment
- pipelines.cpp: keep LoRA adapter loading, compileProperties, adopt main's SPDLOG_ERROR
- http_image_gen_calculator.cc: keep LoRA logic, adopt main's const ref for inpainting tensors
- README.md: accept main's updated examples (model names, sizes, notes)
- Fix downloadFileWithCurl: use overload instead of const ref default parameter
  (was binding temporary to const std::string&)
- Add HF_TOKEN auth header to curl downloads for HF repos only
  (avoid leaking credentials to arbitrary DIRECT_URL servers)
- Rename authToken -> authTokenHF for clarity
- Skip RUN_UNSTABLE tests when HF_TOKEN is not set
- Provide explicit safetensors filename in download tests
- Restore missing 'curl -O' PNG download commands in image_generation README
- Update copilot-instructions rule 13: expanded dangling reference guidance
- Add missing #include <vector>, <utility> (cpplint)
- Fix comment spacing (cpplint)
- clang-format all changed files
MSVC /W4 treats variable shadowing as error (C4456).
Inner loop variable 'it' shadowed outer pipelinesMap iterator.
- Detect Windows absolute paths (e.g. C:\path\to\file.safetensors)
  in addition to Unix paths (/ and ./ prefixes)
- Also detect .\ prefix for relative Windows paths
- Use find_last_of("/\\") instead of rfind('/') to extract
  filename from both Unix and Windows paths
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant